﻿using System;
using System.Collections.Generic;
using System.Text;

namespace _010_011_012操作符详解_15_
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //算术运算符

            //var x = 3 * 4;
            //Console.WriteLine(x.GetType().FullName);//Int32

            //var y = 3.0 * 5.0;
            //Console.WriteLine(y.GetType().FullName);//Double

            //var z = 3.0 * 4;
            //Console.WriteLine(z.GetType().FullName);//Double    数值提升 以最大精度的变量为主

            //除0异常

            //int x = 5;
            //int y = 0;
            //int z = x / y;
            //Console.WriteLine(z);

            double a = 5.0;
            double b = 0;
            double c = a / b;
            Console.WriteLine(c);  //正无穷大

            double x = -5.0;
            double y = 0;
            double z = x / y;
            Console.WriteLine(z);//负无穷大


            //double a = 0.0;
            //double b = 5.0;
            //double c = a / b;
            //Console.WriteLine(c);

            double d = c / z; 
            Console.WriteLine(d); //NAN

            //余数运算符
            //整数取余
            for (int i = 0; i < 100; i++)
            {
                Console.WriteLine(i % 10);
            }

            double num1 = 3.5;
            double num2 = 3;
            Console.WriteLine(num1%num2);

            //加减法

            var n1 = 3.0 + 4.0;
            Console.WriteLine(n1.GetType().FullName);

            string s1 = "123";
            string s2 = "abc";
            Console.WriteLine(s1+s2);
        }
    }
}
